<template>
	<view id="closeUser">
		<view class="content">
			<view style="text-align: center;font-size:36rpx;padding:10rpx;font-weight:500;">操作提醒</view>
			<view style="color:red;">您正在账户注销操作！！</view>
			<view style="color:red;">请知晓：账户注销后，此账户信息将永久删除，账户内所有权益不可恢复；</view>
		</view>
		<view class="btn-div" style="margin:30rpx;">
			<button type="primary" class="primary" @tap="$refs.alertDialog.open()">确认注销</button>
		</view>
		<uni-popup ref="alertDialog" type="dialog">
			<uni-popup-dialog type="success" cancelText="取消" confirmText="确定" title="提醒" content="确定要注销账户吗？" @confirm="confirm"></uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				
			}
		},
		onLoad(){
		},
		methods: {
			confirm(){
				this.httpClient.upload('agents/agent/destroy',{}).then(res=>{
					if(res.code==1){
						uni.removeStorageSync('loginToken');
						uni.showToast({
							icon: 'none',
							title: '注销成功',
						})
						setTimeout(function() {
							uni.reLaunch({
								url: '/pages/common/login',
							})
						}, 1500)
					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	#closeUser{
		.content{
			background-color: #FFF;padding:50rpx 30rpx;
		}
	}
	
</style>
